/**
 * outsider.com.cn Inc.
 * Copyright (c) 2011-2022 All Rights Reserved.
 */
package com.yuanmeng.common.core.enums;

import lombok.Getter;

/**
 * @author outsider
 * @version Id: ProductTypeEnum.java, v 0.1 2022/6/1 17:16 outsider Exp $$
 */
@Getter
public enum ProductTypeEnum {
    PHYSICAL("1", "实体商品"),

    VIRTUAL("2", "虚拟商品"),

    UNDERWRITING("3", "线下核销类商品");

    private String code;

    private String message;

    ProductTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String codeQueryValue(String productType) {
        for(ProductTypeEnum ENUM : ProductTypeEnum.values()) {
            if(ENUM.code.equals(productType)) {
                return ENUM.getMessage();
            }
        }
        return "";
    }

    public static String valueQueryCode(String productTypeValue) {
        for(ProductTypeEnum ENUM : ProductTypeEnum.values()) {
            if(ENUM.message.equals(productTypeValue)) {
                return ENUM.getCode();
            }
        }
        return "";
    }
}